package cluedo.messages;

import msgcomm.RmiReceiver;
import msgcomm.messages.RequestPayload;

public class RequestAddPlayGroup extends RequestPayload {

	private static final long serialVersionUID = -6565211862537258805L;
	
	/**
	 * nome del gruppo di gioco creato
	 */
	public final String groupName;
	
	/**
	 * nickname del proprietario del gruppo di gioco
	 */
	public final String ownerName;
	
	/**
	 * Transceiver del proprietario del gruppo
	 */
	public final RmiReceiver ownerTrans;
	
	/**
	 * Esito della richiesta
	 */
	public final boolean response;

	public RequestAddPlayGroup(String groupName, String ownerName,RmiReceiver ownerTrans){
		
		this.groupName=groupName;
		this.ownerName=ownerName;
		this.ownerTrans=ownerTrans;
		this.response= false;
	}
	

	public RequestAddPlayGroup(String groupName, boolean response){
		
		this.groupName=groupName;
		this.ownerName=null;
		this.ownerTrans=null;
		this.response= response;
	}
	

	@Override
	public String toString() {
		if (response) {
			return "RequestAddPlayer{"+groupName + ", successo"+"}";
		}else{
			return "RequestAddPlayer{"+groupName + ", da parte di "+ownerName+"}";
		}
		
	}
}
